package com.weic.design.singleton;

/**
 * 懒汉式
 * lazy—loadding
 * 当使用到时才加载
 * 虽然达到了按需初始化的目的，但是存在线程安全问题
 */
public class SingleTon02 {
    public static SingleTon02 INSTANCE;
    private SingleTon02(){

    }
    public static SingleTon02 getInstance(){
        if(null == INSTANCE){
            synchronized (SingleTon02.class){
                if(null == INSTANCE){
                    INSTANCE = new SingleTon02();
                }
            }
        }
        return INSTANCE;
    }
}
